home *** CD-ROM | disk | FTP | other *** search
- Path: cs.uwa.edu.au!gordon
- From: gordon@cs.uwa.edu.au (Gordon Royle)
- Newsgroups: comp.lang.c
- Subject: Re: Does C convert float to double internally ?
- Date: 3 Apr 96 02:03:35 GMT
- Organization: The University of Western Australia
- Message-ID: <gordon.828497015@cs.uwa.edu.au>
- References: <4jsllh$hkf@harbinger.cc.monash.edu.au>
- NNTP-Posting-Host: wallaroo.cs.uwa.oz.au
- X-Newsreader: NN version 6.5.0 #3 (NOV)
-
- bcheung@yoyo.cc.monash.edu.au (Biggles Cheung) writes:
-
- >I was told that C compiler automatically converts "float" variable
- >internally to "double" for + - * / , etc operations. Is this true?
-
- >Can I force the C compiler not to do the conversion as I have an
- >assignment on finding out various computing errors of different
- >precisions?
-
- >My advice from the lecturer is to have temporary variable of
- >float to split a long equation to smaller step so that I can maximize
- >the impact of single precision number on the evaluation. Is this
- >feasible?
-
- If I were you I would write a quick set of routines that performs
- arithmetic to a fixed number of decimal places by simulating rational
- numbers with denominators of 100, or 1000 or 10000.
-
- I tried once to give my students a project on numerical inaccuracy and
- found that it was hard to make any sensible sized examples show really
- bad behaviour, without limiting the number of decimal points to 2 or 3.
-
- gordon
- --
- Gordon Royle ---- gordon@cs.uwa.edu.au
- Visit http://www.cs.uwa.edu.au/~gordon
- --
-